package com.wootion.cims.module.basicinformation.communitysetup.controller;

import com.wootion.cims.module.basicinformation.communitysetup.service.CommunitySituationService;
import com.wootion.cims.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: jack
 * @Date: 2022/12/02/11:10
 * @Description: 社区概况
 */
@RestController
@Api(value = "社区概况")
@RequestMapping("/situation")
public class CommunitySituationController {

    @Resource
    private CommunitySituationService communitySituationService;
    /**
     * 登陆之后，返回给前端的数据
     */
    @RequiresAuthentication
    @GetMapping(path = {"/userinfo"})
    @ApiOperation(value = "登陆-用户信息，角色信息，菜单权限", httpMethod = "GET", notes = "")
    public ResponseResult userInfo(){
        return communitySituationService.userInfo();
    }
    /**
     * 根据用户的社区权限，以及每个社区下的多个小区信息
     */
    @RequiresAuthentication
    @GetMapping(path = "/find/community/polt")
    @ApiOperation(value = "登陆-社区概况", httpMethod = "GET", notes = "")
    public ResponseResult findByCommunityAndPolt(){
        return communitySituationService.findByCommunityAndPolt();
    }

}
